package com.my.pojo;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import java.util.Date;

/**
* @Author: jiChen
* @Description: 用户个人信息实体类
* @Date: 2021/11/29 8:21 上午
*/

@Entity
@Getter
@Setter
@ToString
@RequiredArgsConstructor
@Table(name = "person")
public class Person {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "person_id")
    private Integer personId;

    @Column(name = "name")
    private String name;

    @Column(name = "sex")
    private char sex;

    @Column(name = "birth")
    private Date birth;

    @Column(name = "status")
    private Integer status;


    @OneToOne(mappedBy = "person")
    @JoinColumn(name = "user_id")
    private User user;
}
